package com.zhangbaiyan.test01;

/**
 * @author zhangbaiyan
 * @date 2024-09-22 21:42
 * @description:
 * @version:
 */
public class demo {
    public static void main(String[] args) {

//        MyThread T1 = new MyThread();
//        MyThread T2 = new MyThread();
//
//        T1.setName("线程1：");
//        T2.setName("线程2：");
//
//        T1.start();
//        T2.start();
        //创建MyRun对象
        //表示多线程要执行的任务
        MyRun mr = new MyRun();

        //创建线程对象
        Thread t1 =new Thread(mr);
        Thread t2 =new Thread(mr);

        //给线程设置名字
        t1.setName("线程1：");
        t2.setName("线程2：");
        t1.start();
        t2.start();


    }
}
